package com.sc.nft.dao;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.UserReward;
import com.sc.nft.mapper.UserRewardMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

@Slf4j
@Repository
public class UserRewardDao extends ServiceImpl<UserRewardMapper, UserReward> {

    /**
     * 根据签到活动Id获取已发放奖励
     * @param activityBasicsId
     * @return
     */
    public Long equityCount(Long activityBasicsId) {
        return baseMapper.equityCount(activityBasicsId);
    }

    /**
     * 获取用户已发放奖励次数
     * @param rewardByActivityId
     * @param userId
     * @return
     */
    public Integer getUserRewardByRewardAllocationId(Long rewardByActivityId,Long userId) {
        return baseMapper.getUserRewardByRewardAllocationId(rewardByActivityId,userId);
    }
}
